Runs a command from the Windows command prompt on the test computer and returns the exit code when it finishes. The command finishes before playback continues. For example, use this statement to run a batch file that sets environment variables on the test computer before the test application starts.
To continue playback while the command runs, use the RunBackgroundCommand statement.
Note: Issues may occur when using this statement in load test scripts.
Syntax
RunCommand("ExecutablePath", "WorkingDirectory", "CommandLineArguments")
Arguments
| Argument | Description |
|---|---|
| ExecutablePath | Full path to the executable, batch file, or command file to run in the background. |
| WorkingDirectory | Full path to the executable working directory. |
| CommandLineArguments | Arguments to include in the command line call. |
Return value
| Value | Description |
|---|---|
| Value | Exit code from the command. |
Example
exitCode = RunCommand("C:\\Windows\\regedit.exe", "C:\\Windows", "/s"", C:\\RegistryUtils\\ExportedKey.reg")
PrintLn("Registry utility exit code: " + exitCode)